﻿<%@ Page Title="Title" Language="C#" Inherits="System.Web.Mvc.ViewPage<object>" MasterPageFile="~/Views/Shared/Site.Master" %>
<asp:Content runat="server" ID="Title" ContentPlaceHolderID="TitleContent"></asp:Content>
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
<h3>Settings (change the default values of the controls)</h3>
<p class="te">
you can change the default values of the controls by calling something like this:
</p>
<pre class="prettyprint">
Settings.AjaxList.MoreText = "show more results";
Settings.Lookup.OkText = "Choose";
Settings.Lookup.ClearButton = true;
Settings.MultiLookup.Fullscreen = true;
</pre>
<p class="te">
usually you would call this in Global.asax.cs Application_Start
</p>

<h3>Translating default texts</h3>
<p class="te">
A function can be assigned to Settings.GetText, this function will receive 2 parameters (name of the control, and key of the text) and must return a string, this way you can return a different text depending on current UI culture:
</p>
<pre class="prettyprint">
Settings.GetText = (n, k) =gt;
     {     
         if (k == "CancelText") return "Cancel";
         if (k == "SearchText") return "Search";
         if (k == "MoreText") return "More results";
         if (n == "MultiLookup" && k == "Title")
             return "please select some items";  
         if (n == "Lookup" && k == "Title")
             return "please select an item";
         return "";
     };
</pre>
    <script type="text/javascript">
        $(function () {
            prettyPrint();
        });
    </script>

</asp:Content>
